﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SD.DataAccess;
using System.Collections.ObjectModel;

namespace SD.Business
{
    public partial class ProgramBUS
    {
	/// <summary>
        /// add new program to database
        /// </summary>
        /// <param name="newProgram"> an instance of program class </param>
        /// <returns> true or false </returns>
        
        public bool AddProgram(Program newProgram)
        {
            bool success = new Program().AddProgram(newProgram);
            return success;
        }

	/// <summary>
        /// edit new program to database
        /// </summary>
        /// <param name="newProgram"> an instance of program class </param>
        /// <returns> true or  false </returns>
        public bool AmendProgram(Program newProgram)
        {
            bool success = new Program().AmendProgram(newProgram);
            return success;
        }

	 /// <summary>
        /// edit status program to database
        /// </summary>
        /// <param name="programId"> programId want to edit status </param>
        /// <param name="status"> status program want to change </param>
        /// <returns> true or false </returns>
        public bool ChangeProgramStatus(int programId, bool status)
        {
            bool success = new Program().ChangeProgramStatus(programId, status);
            return success;
        }
	

        /// <summary>
        /// get list program 
        /// </summary>
        /// <param name="status"> status want to select </param>
        /// <param name="filter"> type of filter </param>
        /// <returns> list program </returns>
        public IQueryable<ProgramView> ListProgram(bool status, Collection<string> filter)
        {
            IQueryable<ProgramView> newProgram = new Program().ListProgram(status, filter);
            return newProgram;
        }

	/// <summary>
        /// get program selected
        /// </summary>
        /// <param name="programId"> programId selected </param>
        /// <returns> program </returns>
        public ProgramView GetProgram(int programId)
        {
            ProgramView newProgram = new Program().GetProgram(programId);
            return newProgram;
        }

	/// <summary>
        /// check name has already existed ?
        /// </summary>
        /// <param name="name"> name want to check </param>
        /// <returns> true or false </returns>
        public bool CheckNameProgram(string name)
        {
            bool success = new Program().CheckNameProgram(name);
            return success;
        }
    }
}
